package com.opcua.client.mvc.main;
import java.net.URL;
import java.util.ResourceBundle;
import javax.inject.Inject;
import com.opcua.client.mvc.attributes.AttributesView;
import com.opcua.client.mvc.service.PersistenceService;
import com.opcua.client.mvc.binding.StatusBinding;
import com.opcua.client.mvc.connect.ConnectView;
import com.opcua.client.mvc.datatree.DataTreeView;
import com.opcua.client.mvc.events.EventsView;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.BorderPane;
public class MainViewPresenter implements Initializable {
  @Inject
  PersistenceService session;
  @Inject
  StatusBinding state;
  @FXML
  ProgressIndicator progress;
  @FXML
  Label status;
  @FXML
  BorderPane mainPane;
  @FXML
  private SplitPane vSplitPane;
  @FXML
  private SplitPane hSplitPane;
  @Override
  public void initialize(URL location, ResourceBundle resources) {
    progress.visibleProperty().bind(state.progressVisibleProperty());
    status.textProperty().bind(state.statusTextProperty());
    ConnectView connect = new ConnectView();
    mainPane.setTop(connect.getView());
    DataTreeView treeView = new DataTreeView();
    AttributesView attr = new AttributesView();
    hSplitPane.setDividerPosition(0, 0.7);
    hSplitPane.getItems().addAll(treeView.getView(), attr.getView());
    EventsView events = new EventsView();
    vSplitPane.setDividerPosition(0, 0.8);
    vSplitPane.getItems().add(events.getView());
  }
}
